{include file=header.html}
{include file=top.html}
<style>
    .coupon{}
    .coupon li{position: relative;text-align: left;width:288px;float:left;border: 1px solid #eee;margin:0 10px 10px 0;padding: 12px 15px;}
    .coupon li.last{margin-right:0px;}
    .coupon li p{height: 24px;line-height: 24px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;font-size: 14px;text-align: center;}
    .coupon li .name{color: #666;font-weight:bold;}
    .coupon li .price{color:#f76120;font-size:15px;border-bottom: 1px #ddd dashed;padding-bottom:5px;}
    .coupon li .time{padding-top:5px;}
</style>
<script>
    function add_coupon(coupon_id){
        <!--{if !$visitor.user_id}-->
        alert(lang.login_please);
        return;
        <!--{/if}-->
        var url = SITE_URL + '/index.php?app=my_coupon&act=add';
            $.getJSON(url, {'coupon_id': coupon_id}, function (data) {
            if (data.done)
            {
                alert(data.retval);
            }
            else
            {
                alert(data.msg);
            }
        });
    }
</script>
<div id="content">
    <div id="left">
        {include file=left.html}
    </div>
    <div id="right">
        <ul class="coupon">
            <!--{foreach from=$coupons item=coupon name=fe_coupon}-->
            <li onclick="add_coupon({$coupon.coupon_id})" <!--{if $smarty.foreach.fe_coupon.iteration % 3 eq 0}-->class="last"<!--{/if}-->>
                <img  src="{$coupon.coupon_bg|escape}" width="288" height="160">
                <p class="name" >{$coupon.coupon_name}</p>
                <p class="price" >
                    <!--{if $coupon.coupon_value}-->{$lang.man}{$coupon.min_amount|price}{$lang.can_deduct}{$coupon.coupon_value|price}<!--{else}-->{$lang.no_limit}<!--{/if}-->
                </p>
                <p class="time" >{$coupon.start_time|date} {$lang.zhi} <!--{if $coupon.end_time}-->{$coupon.end_time|date}<!--{else}-->{$lang.no_limit}<!--{/if}--></p>
            </li>
            <!--{/foreach}-->
        </ul>
    </div>
    <div class="clear"></div>
</div>
{include file=footer.html}